/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com
 @idle games : http://www.gityx.com
 @QQ Group : 627141737

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //未分类：
    'Save': '保存',
    'Export': '导出',
    'Import': '导入',
    'Settings': '设置',
    'Achievements': '成就',
    'Statistics': '统计',
    'Changelog': '更新日志',
    'Hotkeys': '快捷键',
    'ALL': '全部',
    'Default': '默认',
    'AUTO': '自动',
    'default': '默认',
    "points": "点数",
    "Reset for +": "重置得到 + ",
    "Currently": "当前",
    "Effect": "效果",
    "Cost": "成本",
    "Goal:": "目标:",
    "Reward": "奖励",
    "Start": "开始",
    "Exit Early": "提前退出",
    "Finish": "完成",
    "Milestone Gotten!": "获得里程碑！",
    "Milestones": "里程碑",
    "Completed": "已完成",
    "Achievement Gotten!": "成就达成！",
    "special thank you to CryptoGrounds for allowing me to use some of his ideas to make a knockoff of": "特别感谢 CryptoGrounds 允许我使用他的一些想法来仿制",
    "Are you sure?": "你确定吗？",
    "Automators": "自动化设备",
    "Brew It!": "酿造它！",
    "Brew Red Juice": "酿造红色果汁",
    "Brewing": "酿造",
    "Buy Amount: 1": "购买数量：1",
    "Cost: None": "费用：无",
    "Delete Save (Exports)": "删除保存（导出）",
    "Discord Link!": "Discord链接！",
    "Export Save": "导出保存",
    "Filling": "填充",
    "Gain +0.00 Golden Flasks on Prestige": "威望获得 +0.00 金瓶",
    "Gaining 0.00 Mystical Flasks/s": "获得 0.00 神秘烧瓶/秒",
    "Game Loaded": "游戏已加载",
    "Game Saved": "游戏已保存",
    "Idle Research": "空闲研究",
    "Import Save": "导入保存",
    "Lab": "实验室",
    "Mastery": "精通",
    "New things have been added since last time": "自上次以来已添加新内容",
    "No!": "否！",
    "Prestige": "声望",
    "Prestige!": "声望！",
    "Red Juice 0.00": "红汁 0.00",
    "Save Game": "保存游戏",
    "Start Mastering": "开始精通",
    "Submit": "提交",
    "Test ??? Flask": "测试 ？？？ 烧瓶",
    "Test Red Flask": "测试红色烧瓶",
    "Testing": "测试",
    "Thanks!": "谢谢！",
    "Welcome back gamer!": "欢迎回来游戏玩家！",
    "Welcome Back!": "欢迎回来！",
    "What is mastery?": "什么是掌握？",
    "When you start mastering you will do a prestige reset and your energy gain will be only 1/4th of what it usually is but you will gain mystical flasks even though they won't have any effect while running it.": "当您开始精通时，您将进行声望重置，您的能源增益将仅为通常的 1/4，但您将获得神秘的烧瓶，即使它们在运行时不会有任何效果。",
    "Yes!": "是！",
    "A special thank you to CryptoGrounds for allowing me to use some of his ideas to make a knockoff of": "特别感谢 CryptoGrounds 允许我使用他的一些想法来仿制",
    "Testing ??? Flask": "测试 ??? 烧瓶",
    "-=Red Flask=-": "-=红色烧瓶=-",
    "-=Orange Flask=-": "-=橙色烧瓶=-",
    "-=Blue Flask=-": "-=蓝色烧瓶=-",
    "-=Black Flask=-": "-=黑色烧瓶=-",
    "-=Pink Flask=-": "-=粉色烧瓶=-",
    "-=Yellow Flask=-": "-=黄色烧瓶=-",
    "-=Purple Flask=-": "-=紫色烧瓶=-",
    "-=White Flask=-": "-=白色烧瓶=-",
    "-=Green Flask=-": "-=绿色烧瓶=-",
    "Brew": "酿造",
    "Fill Flask": "填充烧瓶",
    "[1] - Flask I": "[1] - 烧瓶 I",
    "[10] - Energy": "[10] - 能源",
    "[11] - Energized": "[11] - 通电",
    "[12] - Energetic": "[12] - 精力充沛",
    "[13] - Energizer": "[13] - 劲量",
    "[14] - Power Plant": "[14] - 发电厂",
    "[15] - Unlimited Power": "[15] - 无限力量",
    "[16] - Gold": "[16] - 黄金",
    "[17] - Gilded": "[17] - 镀金",
    "[18] - Golden": "[18] - 金色",
    "[19] - Midas": "[19] - 大富翁",
    "[2] - Flask II": "[2] - 烧瓶 II",
    "[20] - Mysterious": "[20] - 神秘",
    "[21] - Mystic": "[21] - 神秘主义者",
    "[22] - Mastering": "[22] - 掌握",
    "[23] - Mastered": "[23] - 精通",
    "ON": "开",
    "OFF": "关",
    "Red Juice": "红色果汁",
    "Yellow Juice": "黄色果汁",
    "Green Juice": "绿色果汁",
    "Blue Juice": "蓝色果汁",
    "Pink Juice": "粉色果汁",
    "Purple Juice": "紫色果汁",
    "White Juice": "白色果汁",
    "Unlock the Red Flask": "解锁红色烧瓶",
    "Unlock the Blue Flask": "解锁蓝色烧瓶",
    "Unlock the Yellow Flask": "解锁黄色烧瓶",
    "Unlock the Orange Flask": "解锁橙色烧瓶",
    "Unlock the Black Flask": "解锁黑色烧瓶",
    "Unlock the Purple Flask": "解锁紫色烧瓶",
    "Unlock the Pink Flask": "解锁粉色烧瓶",
    "Unlock the Green Flask": "解锁绿色烧瓶",
    "Unlock the White Flask": "解锁白色烧瓶",
    "Yellow Juice": "黄色果汁",
    "Orange Juice": "橙色果汁",
    "Automatic Black": "自动黑色",
    "Automatic Blue": "自动蓝色",
    "Automatic Green": "自动绿色",
    "Automatic Orange": "自动橙色",
    "Automatic Pink": "自动粉色",
    "Automatic Purple": "自动紫色",
    "Automatic Red": "自动红色",
    "Automatic White": "自动白色",
    "Automatic Yellow": "自动黄色",
    "Are you sure you want to prestige?": "你确定要进行声望？",
    "This will reset all progress in exchange for Golden Flasks": "这将重置所有进度以获得金色烧瓶",
    " Tested!": " 已测试！",
    "Test Red Flask": "测试红色烧瓶",
    "Test Orange Flask": "测试橙色烧瓶",
    "Test Blue Flask": "测试蓝色烧瓶",
    "Test Black Flask": "测试黑色烧瓶",
    "Test Pink Flask": "测试粉色烧瓶",
    "Test Yellow Flask": "测试黄色烧瓶",
    "Test Purple Flask": "测试紫色烧瓶",
    "Test White Flask": "测试白色烧瓶",
    "Test Green Flask": "测试绿色烧瓶",
    "Testing Red Flask": "测试红色烧瓶",
    "Testing Orange Flask": "测试橙色烧瓶",
    "Testing Blue Flask": "测试蓝色烧瓶",
    "Testing Black Flask": "测试黑色烧瓶",
    "Testing Pink Flask": "测试粉色烧瓶",
    "Testing Yellow Flask": "测试黄色烧瓶",
    "Testing Purple Flask": "测试紫色烧瓶",
    "Testing White Flask": "测试白色烧瓶",
    "Testing Green Flask": "测试绿色烧瓶",
    "Are you sure you want to begin mastering?": "您确定要开始精通吗？",
    "Start Mastering to gain Mystical Flasks": "开始精通以获得神秘烧瓶",
    "This will trigger a prestige reset and start mastery.": "这将触发声望重置并开始精通。",
    "Gold Unlocked!": "黄金已解锁！",
    "Stop Mastering": "停止精通",
    "Can't prestige while mastering": "精通时无法声望",
    "Import your save": "导入存档",
    "Save File Exported to Clip Board": "存档已复制到剪切板",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    // 图标代码，不能汉化
    "Jacorb's Games": "Jacorb's Games",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "By Jacorb90": "By Jacorb90",
    "content_copy": "content_copy",
    "library_books": "library_books",
    "discord": "discord",
    "drag_handle": "drag_handle",
    "edit": "edit",
    "forum": "forum",
    "content_paste": "content_paste",
    "delete": "delete",
    "info": "info",
    "settings": "settings",

    //树游戏
    'Loading...': '加载中...',
    'ALWAYS': '一直',
    'HARD RESET': '硬重置',
    'Export to clipboard': '导出到剪切板',
    'INCOMPLETE': '不完整',
    'HIDDEN': '隐藏',
    'AUTOMATION': '自动',
    'NEVER': '从不',
    'ON': '打开',
    'OFF': '关闭',
    'SHOWN': '显示',
    'Play Again': '再次游戏',
    'Keep Going': '继续',
    'The Modding Tree Discord': '模型树Discord',
    'You have': '你有',
    'It took you {{formatTime(player.timePlayed)}} to beat the game.': '花费了 {{formatTime(player.timePlayed)}} 时间去通关游戏.',
    'Congratulations! You have reached the end and beaten this game, but for now...': '恭喜你！ 您已经结束并通关了本游戏，但就目前而言...',
    'Main Prestige Tree server': '主声望树服务器',
    'Reach {{formatWhole(ENDGAME)}} to beat the game!': '达到 {{formatWhole(ENDGAME)}} 去通关游戏!',
    "Loading... (If this takes too long it means there was a serious error!": "正在加载...（如果这花费的时间太长，则表示存在严重错误！",
    'Loading... (If this takes too long it means there was a serious error!)←': '正在加载...（如果时间太长，则表示存在严重错误！）←',
    'Main\n\t\t\t\tPrestige Tree server': '主\n\t\t\t\t声望树服务器',
    'The Modding Tree\n\t\t\t\t\t\t\tDiscord': '模型树\n\t\t\t\t\t\t\tDiscord',
    'Please check the Discord to see if there are new content updates!': '请检查 Discord 以查看是否有新的内容更新！',
    'aqua': '水色',
    'AUTOMATION, INCOMPLETE': '自动化，不完整',
    'LAST, AUTO, INCOMPLETE': '最后，自动，不完整',
    'NONE': '无',
    'P: Reset for': 'P: 重置获得',
    'Git游戏': 'Git游戏',
    'QQ群号': 'QQ群号',
    'x': 'x',
    'QQ群号:': 'QQ群号:',
    '* 启用后台游戏': '* 启用后台游戏',
    '更多同类游戏:': '更多同类游戏:',
    'H': 'H',
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "\n": "",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    //树游戏
    "\t\t\t": "\t\t\t",
    "\n\n\t\t": "\n\n\t\t",
    "\n\t\t": "\n\t\t",
    "\t": "\t",
    "Show Milestones: ": "显示里程碑：",
    "Autosave: ": "自动保存: ",
    "Offline Prod: ": "离线生产: ",
    "Completed Challenges: ": "完成的挑战: ",
    "High-Quality Tree: ": "高质量树贴图: ",
    "Offline Time: ": "离线时间: ",
    "Theme: ": "主题: ",
    "Anti-Epilepsy Mode: ": "抗癫痫模式：",
    "In-line Exponent: ": "直列指数：",
    "Single-Tab Mode: ": "单标签模式：",
    "Time Played: ": "已玩时长：",
    "Shift-Click to Toggle Tooltips: ": "Shift-单击以切换工具提示：",
    "Achievements Unlocked: ": "成就解锁：",
    "You were gone for ": "你离开了 ",
    "Buy Amount: ": "购买数量：",
    "Mastery Confirm: ": "精通确认：",
    "Prestige Confirm: ": "声望确认：",
    "Yellow Flask": "黄色烧瓶",
    "Orange Flask": "橙色烧瓶",
    "Red Flask": "红色烧瓶",
    "Green Flask": "绿色烧瓶",
    "White Flask": "白色烧瓶",
    "Purple Flask": "紫色烧瓶",
    "Pink Flask": "粉色烧瓶",
    "Blue Flask": "蓝色烧瓶",
    "Black Flask": "黑色烧瓶",
    "Current Version: ": "当前版本: ",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需处理的后缀
var cnPostfix = {
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": " ",
    "\n": "",
    "\n\t\t\t": "\n\t\t\t",
    "\t\t\n\t\t": "\t\t\n\t\t",
    "\t\t\t\t": "\t\t\t\t",
    "\n\t\t": "\n\t\t",
    "\t": "\t",
    "x Research Speed]": "x 研究速度]",
    " Energy Gain]": " 能源增益]",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^(\d+)$/,
    /^\s*$/, //纯空格
    /^([\d\.]+):([\d\.]+)$/,
    /^([\d\.]+):([\d\.]+):([\d\.]+)$/,
    /^([\d\.]+)\-([\d\.]+)\-([\d\.]+)$/,
    /^([\d\.]+)e(\d+)$/,
    /^v0.(.+)$/,
    /^([\d\.]+)$/,
    /^([\d\.]+) \[x([\d\.]+)$/,
    /^([\d\.,]+) \[x([\d\.]+)$/,
    /^([\d\.,]+) \[x([\d\.,]+)$/,
    /^([\d\.]+) \[\+([\d\.]+)\/s\]$/,
    /^([\d\.,]+) \[\+([\d\.]+)\/s\]$/,
    /^([\d\.,]+) \[\+([\d\.,]+)\/s\]$/,
    /^([\d\.]+)e([\d\.,]+) \[\+([\d\.,]+)\/s\]$/,
    /^([\d\.]+)e([\d\.,]+) \[\+([\d\.]+)e([\d\.,]+)\/s\]$/,
    /^([\d\.]+)\%$/,
    /^\(([\d\.]+)\%\)$/,
    /^([\d\.]+):([\d\.]+):([\d\.]+)$/,
    /^([\d\.]+)K$/,
    /^([\d\.]+)M$/,
    /^([\d\.]+)B$/,
    /^([\d\.]+) K$/,
    /^([\d\.]+) M$/,
    /^([\d\.]+) B$/,
    /^([\d\.]+)s$/,
    /^([\d\.]+)x$/,
    /^x([\d\.]+)$/,
    /^([\d\.,]+)$/,
    /^\+([\d\.,]+)$/,
    /^\-([\d\.,]+)$/,
    /^([\d\.,]+)x$/,
    /^x([\d\.,]+)$/,
    /^([\d\.,]+) \/ ([\d\.,]+)$/,
    /^([\d\.]+)e([\d\.,]+)$/,
    /^e([\d\.]+)e([\d\.,]+)$/,
    /^x([\d\.]+)e([\d\.,]+)$/,
    /^([\d\.]+)e([\d\.,]+)x$/,
    /^[\u4E00-\u9FA5]+$/
];
var cnExcludePostfix = [
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
//换行加空格：\n(.+)
var cnRegReplace = new Map([
    [/^([\d\.]+) hours ([\d\.]+) minutes ([\d\.]+) seconds$/, '$1 小时 $2 分钟 $3 秒'],
    [/^You are gaining (.+) elves per second$/, '你每秒获得 $1 精灵'],
    [/^Gaining (.+) Mystical Flasks\/s$/, '每秒获得 $1 神秘烧瓶'],
    [/^Gain (.+) Golden Flasks on Prestige$/, '声望获得 $1 金色烧瓶'],
    [/^Flask (.+) Unlocked!$/, '烧瓶 $1 已解锁！'],
    [/^Reach (.+) Energy$/, '达到 $1 能源'],
    [/^The current version is v(.+), View the Changelog (in settings) for details$/, '当前版本为 v$1，查看 更新日志（在设置中）了解详情'],
    [/^Reach (.+) Mystical Flasks$/, '达到 $1 神秘烧瓶'],
    [/^Reach (.+) Golden Flasks$/, '达到 $1 金色烧瓶'],
    [/^You have (.+) points$/, '你有 $1 点数'],
    [/^Next at (.+) points$/, '下一个在 $1 点数'],
    [/^\[(.+)\] \- Flask (.+)$/, '[$1] \- 烧瓶 $2'],
    [/^Time to Test: ([\d\.]+)s$/, '测试时间： $1秒'],
    [/^Time To Test: ([\d\.]+)s$/, '测试时间： $1秒'],
    [/^Time to Test: ([\d\.]+)m ([\d\.]+)s$/, '测试时间： $1分 $2秒'],
    [/^Time To Test: ([\d\.]+)m ([\d\.]+)s$/, '测试时间： $1分 $2秒'],
    [/^Time To Test: ([\d\.]+)h ([\d\.]+)m ([\d\.]+)s$/, '测试时间： $1小时 $2分 $3秒'],
	[/^([\d\.]+)\/sec$/, '$1\/秒'],
	[/^([\d\.,]+)\/sec$/, '$1\/秒'],
	[/^([\d\.,]+) OOMs\/sec$/, '$1 OOMs\/秒'],
	[/^([\d\.]+) OOMs\/sec$/, '$1 OOMs\/秒'],
	[/^([\d\.]+)e([\d\.,]+)\/sec$/, '$1e$2\/秒'],
    [/^requires ([\d\.]+) more research points$/, '需要$1个研究点'],
    [/^([\d\.]+)e([\d\.,]+) points$/, '$1e$2 点数'],
    [/^([\d\.]+) Golden Flasks$/, '$1 金色烧瓶'],
    [/^([\d\.]+) Mystical Flasks \[x(.+) Energy Gain\]$/, '$1 神秘烧瓶 \[x$2 能源增益\]'],
    [/^([\d\.]+) elves$/, '$1 精灵'],
    [/^([\d\.]+)d ([\d\.]+)h ([\d\.]+)m$/, '$1天 $2小时 $3分'],
    [/^([\d\.]+)e([\d\.,]+) elves$/, '$1e$2 精灵'],
    [/^([\d\.,]+) elves$/, '$1 精灵'],
    [/^([\d\.]+) Mystical Flasks \[x([\d\.]+)$/, '$1 神秘烧瓶 [x$2'],
    [/^\*(.+) to electricity gain$/, '\*$1 到电力增益'],
    [/^\-(.+) Orange Juice$/, '\-$1 橙色果汁'],
    [/^\-(.+) Yellow Juice$/, '\-$1 黄色果汁'],
    [/^\-(.+) Blue Juice$/, '\-$1 蓝色果汁'],
    [/^\-(.+) Pink Juice$/, '\-$1 粉色果汁'],
    [/^\-(.+) White Juice$/, '\-$1 白色果汁'],
    [/^\-(.+) Purple Juice$/, '\-$1 紫色果汁'],
    [/^\-(.+) Green Juice$/, '\-$1 绿色果汁'],
    [/^\-(.+) Black Juice$/, '\-$1 黑色果汁'],
    [/^\-(.+) Red Juice$/, '\-$1 红色果汁'],
    [/^\-(.+) Energy$/, '\-$1 能源'],
    [/^\+(.+) Green Energy$/, '\+$1 绿色能源'],
    [/^(.+)\/(.+) Green Energy$/, '$1\/$2 绿色能源'],
    [/^ is (.+)x Stronger$/, ' 增强 $1x'],
    [/^Cost: (.+) points$/, '成本：$1 点数'],
    [/^Cost: (.+) Golden Flasks$/, '成本：$1 金色烧瓶'],
    [/^Req: (.+) \?\?\? Flask$/, '要求：$1 ??? 烧瓶'],
    [/^Req: (.+) Purple Flask$/, '要求：$1 紫色烧瓶'],
    [/^Req: (.+) Pink Flask$/, '要求：$1 粉色烧瓶'],
    [/^Req: (.+) Green Flask$/, '要求：$1 绿色烧瓶'],
    [/^Req: (.+) Black Flask$/, '要求：$1 黑色烧瓶'],
    [/^Req: (.+) White Flask$/, '要求：$1 白色烧瓶'],
    [/^Req: (.+) Blue Flask$/, '要求：$1 蓝色烧瓶'],
    [/^Req: (.+) Yellow Flask$/, '要求：$1 黄色烧瓶'],
    [/^Req: (.+) Orange Flask$/, '要求：$1 橙色烧瓶'],
    [/^Req: (.+) Red Flask$/, '要求：$1 红色烧瓶'],
    [/^Req: (.+) Green Energy$/, '要求：$1 绿色能源'],
    [/^Req: (.+) elves$/, '要求：$1 精灵'],
    [/^Req: (.+) \/ (.+) elves$/, '要求：$1 \/ $2 精灵'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);